var pageStatus = true;
var footH = $('.page-footer').height();
if(footH == null)
{
	footH = $('.footer-five-grid').height();
	if(footH == null)
	{
		footH = 0;
	}
}

var $thelist = $('#thelist');
var $fucType = $thelist.attr('data-type');
var url = $thelist.attr('data-url');
//拉下开始页数

var page = 2;

var isLoading = false;

function spcenter(info)//随拍
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="ub cl-b-white clickable ssp-item href-js" data-url="/weixin/suipai/detail?id=' + temp.id + '">'
			+ '<img src="' + temp.uavatar + '" class="ssp-tx tx-cir lazy ' + lazy + '">'
			+ '<div class="ub-f1 ssp-cotent">'
			+ '<p class="ssp-content-article cl-f-grey">'
			+ '<span class="cl-f-orange">' + temp.title + '</span>'
			+ '</p>'
			+ '<ul class="ssp-content-img" data-pic="' + temp.pic + '">';
		if(temp.thumb.length > 0)
		{
			for(var j = 0; j < temp.thumb.length; j++)
			{
				var pic = temp.thumb[j];
				str += '<li class="lazy ' + lazy + ' show-pic" data-original="' + pic.thumb + '" data-pic="' + pic.pic + '"><img src="'+ img_url +'/o6.png" class="oimg"></li>'
			}
		}
		str += '</ul>'
			+ '<div class="ssp-content-foot ub ub-pj">'
			+ '<p class="ssp-content-time cl-f-lgrey">' + temp.create_time + '</p>'
			+ '<div class="option-wrapper ub">'
		    + '<div class="like ub ub-pc ub-ac">'
	    	+ '<span class="icon-like"></span><p class="like-text cl-f-orange">0</p>'
		    + '</div>'
			+ '<div class="comment ub ub-pc ub-ac">'
	    	+ '<span class="icon-comment"></span><p class="comment-text cl-f-orange">' + temp.msgnum + '</p>'
		    + '</div>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function workcenter(info)//食谱
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable href-js" data-url="/weixin/work/detail?workid=' + temp.workid + '">'
			+ '<div class="ub ub-ac">'
			+ '<div class="dongtai-img lazy ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o7.png" class="oimg"></div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f14">' + temp.title + '</h3>'
			+ '<p class="dongtai-article cl-f-lgrey f12">' + temp.content + '</p>'
			+ '<div class="option-wrapper ub">'
			+ '<div class="like ub ub-pc ub-ac">'
			+ '<span class="icon-like-grey"></span><p class="like-text cl-f-lgrey f12">' + temp.goodnum + '</p>'
			+ '</div>'
			+ '<div class="comment ub ub-pc ub-ac">'
			+ '<span class="icon-comment-grey"></span><p class="comment-text cl-f-lgrey f12">' + temp.msgnum + '</p>'
			+ '</div>'
			+ '</div>'
			+ '<span class="dongtai-status cl-b-lorange cl-f-white f12">' + temp.status + '</span>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function teachcenter(info)//导师
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable href-js" data-url="/weixin/teach/detail?teachid=' + temp.teachid + '">'
			+ '<div class="ub ub-ac">'
		if(temp.ifimg == 1)
		{
			str += '<div class="dongtai-img lazy ' + lazy + '" data-original="' + temp.image + '">';
		}
		else
		{
			str += '<div class="dongtai-img lazy ' + lazy + '" data-original="' + img_url + '/touxiang5.png">';
		}
		str += '<img src="' + img_url + '/odaoshi.png" class="oimg">';
		if(temp.iflight == 1)
		{
			str += '<img src="' + img_url + '/jian.png" alt="" class="jian">';
		}
		
		var mark = "";
		if(temp.type == 2)
		{
			mark = '<span class="mark cl-b-orange cl-f-white" >作品</span>';
		}
		
		str += '</div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f14">' + temp.title + mark+'</h3>'
			+ '<p class="daoshi-text cl-f-lgrey f12">' + temp.content + '</p>'
			+ '<div class="option-wrapper ub">'
			+ '<div class="comment ub ub-pc ub-ac ub-f1">'
			+ '<span class="icon-comment-grey"></span><p class="comment-text cl-f-lgrey f12">' + temp.msgnum + '</p>'
			+ '<span class="user-daoshi-r ub-f1 cl-f-lgrey f12"><span class="cl-f-orange">' + temp.nickname + '</span>' + temp.create_time + '</span>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function reportlist(info)//试用报告
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable">'
			+ '<div class="ub ub-ac">'
			+ '<div class="dongtai-img lazy" data-original="' + temp.image + '"><img src="' + img_url + '/o7.png" class="oimg"></div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f14 text-overflow">' + temp.title + '</h3>'
			+ '<p class="shiyong-article cl-f-xxlgrey f12">' + temp.content + '</p>'
			+ '<p class="dongtai-article cl-f-xxlgrey f12">'+ temp.create_time + '发布<a class="cl-f-orange">（查看详情）</a></p>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function sendlist(info)//发件箱
{
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">'
			+ '<img src="' + temp.uavatar + '" class="tx-cir lazy">'
			+ '<div class="ub-f1 mailbox-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">' + temp.title + '</h3>'
			+ '<p class="f14 cl-f-grey msg-text">' + temp.content + '</p>'
			+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function msglist(info)//评论回复
{
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">';
		if(temp.userid == 0)
		{
			str += '<img src="' + img_url + '/yf_logo.png" class="tx-cir lazy">'; 
		}
		else
		{
			if(temp.user.uavatar == null)
			{
				str += '<img src="' + img_url + '/yf_logo.png" class="tx-cir lazy">'; 
			}
			else
			{
				str += '<img src="' + temp.user.uavatar + '" class="tx-cir lazy">';
			}
		}
		str += '<div class="ub-f1 candr-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">';
		if(temp.userid == 0)
		{
			str += '<span style="color: #ff7c46;font-weight: bold;">' + temp.user.nickname + '</span>'; 
		}
		else
		{
			str += temp.user.nickname;
		}
		str += '</h3>'
			+ '<p class="f14 cl-f-grey msg-text">'
			+ temp.msg
			+ '<span class="cl-f-lorange">' + temp.title + '</span>'; 
		if(temp.touserid != '')
		{
			str += '中的评论：';
		}
		else
		{
			str += '中发表评论：';
		}
		str += temp.content
		    + '</p>'
		    + '<div class="option-wrapper ub">'
		    + '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
		    + '<div class="comment ub ub-pc ub-ac">'
		    + '<span class="icon-comment"></span><p class="comment-text cl-f-lorange">回复</p>'
		    + '</div>'
		    + '</div>'
		    + '</div>'
		    + '</li>';
	}
	return str;
}

function digfavlist(info)//点赞收藏
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i< info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable href-js" data-url="">'
			+ '<img src="' + temp.uavatar + '" class="tx-cir lazy">'
			+ '<div class="ub-f1 candl-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">' + temp.title + '</h3>';
		if(temp.type_name == 'dig')
		{
			str += '<p class="f14 cl-f-grey msg-text">'
				+ '给你的';
			if(temp.copyid != '')
			{
				str += '参考作品';
			}
			else
			{
				str += temp.name;
			}
			str += '<span class="cl-f-lorange">' + temp.title + '</span>';
			if(temp.digtype == 0)
			{
				str += '差评';
			}
			else
			{
				str += '点赞';
			}
			str += '</p>';
		}
		else
		{
			str += '<p class="f14 cl-f-grey msg-text">'
				+ '收藏了你的';
			if(temp.copyid != '')
			{
				str += '参考作品';
			}
			else
			{
				str += temp.name;
			}
			str += '<span class="cl-f-lorange">' + temp.title + '</span>'
				+ '</p>';
		}
		str += '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
			+ '</div>'
			+ '<div class="lazy candl-img msg-img ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o2.png" class="oimg"></div>'
			+ '</li>';
	}
	return str;
}

function fanslist(info)//新朋友
{
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">'
			+ '<img src="' + temp.uavatar + '" class="tx-cir lazy">'
			+ '<div class="ub-f1 follow-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">' + temp.nickname + '</h3>'
			+ '<p class="f14 cl-f-grey msg-text">关注了你</p>'
			+ '</div>';
		if(temp.isFans > 0)
		{
			str += '<span class="icon-follow icon-follow-each lazy yf-follow" data-uid="' + temp.myid + '" data-type="cancel">';
		}
		else
		{
			str += '<span class="icon-follow icon-follow-add lazy yf-follow" data-uid="' + temp.myid + '" data-type="add">';
		}
		str += '</li>';
	}
	return str;
}

function prolist(info)//作品审核
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable href-js" data-url="' + temp.url + '">'
			+ '<div class="ub-f1 audit-content">';
		if(temp.type_name == 'suipai')
		{
			str += '<p class="f14 cl-f-grey msg-text">'
			    + '你上传的 随手拍作品'
			    + '<span class="cl-f-lorange">' + temp.title + '</span>';
			if(temp.status == 1)
			{
				str += '已通过审核！';
			}
			if(temp.status == 2)
			{
				str += '未通过审核！';
			}
		    str += '</p>';
		}
		else
		{
			str += '<p class="f14 cl-f-grey msg-text">'
				+ '你上传的作品'
				+ '<span class="cl-f-lorange">' + temp.title + '</span>';
			if(temp.copyid == '')
			{
				if(temp.status == 1)
				{
					str += '已通过系统审核，继续努力，期待您更多作品！';
				}
				if(temp.status == 2)
				{
					str += '未通过审核！';
				}
			}
			else
			{
				if(temp.status == 1)
				{
					str += '已通过审核，来一起学习更多烘焙知识吧！';
				}
				if(temp.status == 2)
				{
					str += '未通过审核！';
				}
			}
	        str += '</p>';
		}
		str += '<p class="msg-time cl-f-lgrey">' + temp.modify_time + '</p>'
			+ '</div>'
			+ '<div class="lazy msg-img ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o2.png" class="oimg"></div>'
			+ '</li>';
	}
	return str;
}

function copyprolist(info)//参考作品
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">'
			+ '<img src="' + temp.uavatar + '" class="tx-cir lazy">'
			+ '<div class="ub-f1 reference-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">' + temp.nickname + '</h3>'
			+ '<p class="f14 cl-f-grey msg-text">参考你的<span class="cl-f-lorange">' + temp.title + '</span>添加了作品</p>'
			+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
			+ '</div>'
			+ '<div class="lazy refer-img msg-img ' + lazy + '" data-original="' + temp.copyimg + '"><img src="' + img_url + '/o2.png" class="oimg"></div>'
			+ '</li>';
	}
	return str;
}

function scorelist(info)//积分
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">';
		if(temp.action == 'sign' || temp.action == 'register')
		{
			str += '<div class="ub-f1 score-content">'
				+ '<p class="f14 cl-f-grey msg-text">恭喜，' + temp.content + '</p>'
				+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
				+ '</div>'
				+ '<div class="lazy msg-img icon-score-write ' + lazy + '" data-original="' + img_url + '/icon-qiandao.png"></div>';
		}
		if(temp.action == 'message')
		{
			str += '<div class="ub-f1 score-content">'
				+ '<p class="f14 cl-f-grey msg-text">恭喜，' + temp.content + '</p>'
				+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
				+ '</div>'
				+ '<div class="lazy msg-img icon-score-write ' + lazy + '" data-original="' + img_url + '/icon-score2.png"></div>';
		}
		if(temp.action == 'gift')
		{
		    str += '<div class="ub-f1 score-content">'
				+ '<p class="f14 cl-f-grey msg-text">' + temp.content + '</p>'
				+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
				+ '</div>'
				+ '<div class="lazy msg-img icon-score-write ' + lazy + '" data-original="' + img_url + '/icon-qiandao.png"></div>';
		}
		if(temp.action == 'spadd')
		{
		    str += '<div class="ub-f1 score-content">'
				+ '<p class="f14 cl-f-grey msg-text">'
				+ '恭喜，你发布的随手拍作品'
				+ '<span class="cl-f-lorange">' + temp.title + '</span>'
				+ '，已通过审核，获得' + temp.credits + '积分。'
				+ '</p>'
				+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
				+ '</div>'
				+ '<div class="lazy msg-img icon-score-cam ' + lazy + '" data-original="' + img_url + '/icon-score4.png"></div>'
		}
		if(temp.action == 'workadd')
		{
		    str += '<div class="ub-f1 score-content">'
				+ '<p class="f14 cl-f-grey msg-text">'
				+ '恭喜，你发布的';
			    if(temp.copy_type == 1)
		    	{
			    	str += '烘焙食谱';
		    	}
			    else
		    	{
			    	str += '参考作品';
		    	}
			    str += '<span class="cl-f-lorange">' + temp.title + '</span>'
				    + '，已通过审核，获得' + temp.credits + '积分。'
				    + '</p>'
				    + '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
				    + '</div>'
				    + '<div class="lazy msg-img icon-score-cook ' + img_url + '" data-original="' + img_url + '/icon-score3.png"></div>';
		}
		if(temp.action == 'worksindex')
		{
		    str += '<div class="ub-f1 score-content">';
				+ '<p class="f14 cl-f-grey msg-text">'
				+ '恭喜，你发布的烘焙食谱'
				+ '<span class="cl-f-lorange">' + temp.title + '</span>'
				+ '，被推荐到首页，获得' + temp.credits + '积分'
				+ '</p>'
				+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
				+ '</div>'
				+ '<div class="lazy msg-img icon-score-cook ' + lazy + '" data-original="' + img_url + '/icon-score3.png"></div>';
		}
		str += '</li>';
	}
	return str;
}

function listtrylist(info)//试用
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">'
			+ '<img src="' + temp.uavatar + '" class="tx-cir lazy">'
			+ '<div class="ub-f1 tryout-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">' + temp.title + '</h3>'
			+ '<p class="f14 cl-f-grey msg-text">';
		if(temp.status == 1)
		{
			str += '<span class="cl-f-lorange">已通过审核</span>，请通过站内信提交你的快递信息。';
		}
		else
		{
			str += '<p class="f14 cl-f-grey msg-text">由于你的活跃度不够，因此试用申请<span class="cl-f-lorange">未通过审核</span>，期待你更加活跃哦。</p>';
		}
		str += '</p>'
			+ '<p class="msg-time cl-f-lgrey">' + temp.create_time + '</p>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function sysmsglist(info)//官方通知
{
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">'
			+ '<img src="' + img_url + '/touxiang5.png" class="tx-cir lazy">'
			+ '<div class="ub-f1 officalmsg-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">烘焙圈客服</h3>'
			+ '<p class="f14 cl-f-grey msg-text">' + temp.content + '</p>'
			+ '<p class="msg-time cl-f-lorange">' + temp.create_time + '</p>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function collList(info)//收藏列表
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable href-js" data-url="/weixin/work/detail?workid=' + temp.workid + '">'
			+ '<div class="ub ub-ac">'
			+ '<div class="dongtai-img lazy ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o7.png" class="oimg"></div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f16">' + temp.title + '</h3>'
			+ '<p class="dongtai-article cl-f-lgrey">' + temp.content + '</p>'
			+ '<div class="option-wrapper ub">'
			+ '<div class="dongtai-info ub">'
			+ '<img src="' + temp.uavatar + '"><p class="cl-f-lgrey">' + temp.nickname + '</p>'
			+ '</div>'
			+ '<div class="like ub ub-pc ub-ac">'
			+ '<span class="icon-like-grey"></span><p class="like-text cl-f-lgrey">' + temp.goodnum + '</p>'
			+ '</div>'
			+ '<div class="comment ub ub-pc ub-ac">'
			+ '<span class="icon-comment-grey"></span><p class="comment-text cl-f-lgrey">' + temp.msgnum + '</p>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function worklist(info)//作品列表
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable href-js" data-url="/weixin/work/detail?workid=' + temp.workid + '">'
			+ '<div class="ub ub-ac">'
			+ '<div class="dongtai-img lazy ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o7.png" class="oimg"></div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f16 with-article">' + temp.title + '</h3>'
			+ '<p class="dongtai-article cl-f-lgrey">' + temp.content + '</p>'
			+ '<div class="dongtai-info ub with-article">'
			+ '<img src="' + temp.uavatar + '"><p class="cl-f-lgrey">' + temp.nickname + '</p>'
			+ '</div>'
			+ '<div class="option-wrapper ub">'
			+ '<div class="like ub ub-pc ub-ac">'
			+ '<span class="icon-like-grey"></span><p class="like-text cl-f-lgrey">' + temp.goodnum + '</p>'
			+ '</div>'
			+ '<div class="comment ub ub-pc ub-ac">'
			+ '<span class="icon-comment-grey"></span><p class="comment-text cl-f-lgrey">' + temp.msgnum + '</p>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function comment(info)//所有评论
{
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="ub comment-h1 clickable row" id="msg_' + temp.id + '">'
			+ '<img src="' + temp.uavatar + '" class="tx-cir lazy">'
			+ '<div class="comment-text ub-f1">'
			+ '<p class="cl-f-lorange comment-user" data-user="' + temp.nickname + '" data-id="' + temp.id + '" data-uid="' + temp.userid + '">' + temp.nickname + '</p>'
			+ '<p class="cl-f-lgrey comment-time">' + temp.create_time + '</p>'
			+ '<div class="cl-f-grey comment-content">'
			+ '<p>' + temp.content + '</p>';
		for(var j = 0; j < temp.childlist.length; j++)
		{
			var tempChild = temp.childlist[j];
			str += '<div class="comment-h2 clickable" id="msg_' + tempChild.id + '">'
				+ '<span class="cl-f-lorange comment-user" data-user="' + tempChild.nickname + '" data-id="' + tempChild.id + '" data-uid="' + tempChild.userid + '">' + tempChild.nickname + '@' + tempChild.touser.nickname + '</span>' + tempChild.content
				+ '</div>';
		}
		str += '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function dynamiclist(info)//动态列表
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable href-js" data-url="/weixin/work/detail?workid=' + temp.workid + '">'
			+ '<div class="ub ub-ac">'
			+ '<div class="dongtai-img lazy ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o7.png" class="oimg"></div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f16">' + temp.title + '</h3>'
			+ '<p class="dongtai-article cl-f-lgrey">' + temp.content + '</p>'
			+ '<div class="option-wrapper ub">'
			+ '<div class="dongtai-info ub">'
			+ '<img src="' + temp.uavatar + '"><p class="cl-f-lgrey">' + temp.nickname + '</p>'
			+ '</div>'
			+ '<div class="like ub ub-pc ub-ac">'
			+ '<span class="icon-like-grey"></span><p class="like-text cl-f-lgrey">' + temp.goodnum + '</p>'
			+ '</div>'
			+ '<div class="comment ub ub-pc ub-ac">'
			+ '<span class="icon-comment-grey"></span><p class="comment-text cl-f-lgrey">' + temp.msgnum + '</p>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function portlist(info)
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable href-js" data-url="' + temp.url + '">'
			+ '<div class="ub ub-ac">'
			+ '<div class="dongtai-img lazy ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o7.png" class="oimg"></div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f14 text-overflow">' + temp.title + '</h3>'
			+ '<p class="shiyong-article cl-f-xxlgrey f12">' + temp.content + '</p>'
			+ '<p class="dongtai-article cl-f-xxlgrey f12 ub ub-pj ub-ac">'
			+ '<span><span class="cl-f-lorange">' + temp.username + '</span>' + temp.create_time + '发布</span>'
			+ '<span class="comment ub ub-pc ub-ac">'
			+ '<span class="icon-comment-dgrey"></span><span class="comment-text cl-f-xxlgrey f12">' + temp.msgnum + '</span>'
			+ '</span>'
			+ '</p>'
			+ '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function trylist(info)
{
	var lazy = 'lazy' + page;
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="dongtai-item cl-b-white row clickable href-js" data-url="' + temp.url + '">'
			+ '<div class="ub ub-ac">'
			+ '<div class="dongtai-img lazy ' + lazy + '" data-original="' + temp.image + '"><img src="' + img_url + '/o7.png" class="oimg"></div>'
			+ '<div class="ub-f1 dongtai-text">'
			+ '<h3 class="cl-f-dgrey f14 text-overflow">' + temp.title + '</h3>'
			+ '<p class="dongtai-article cl-f-lgrey f12 text-overflow">申请于' + temp.create_time + '</p>'
			+ '<span class="dongtai-status cl-b-lorange cl-f-white f12">' + temp.statusType + '</span>';
			if(temp.status == 1)
			{
				if(temp.isReport == 0)
				{
					str += '<span class="dongtai-status cl-b-lorange cl-f-white f12 href-js" data-url="/weixin/try/addReport?id=' + temp.tryid + '">发布报告</span>';
				}
				else
				{
					str += '<span class="dongtai-status cl-b-lorange cl-f-white f12 href-js" data-url="/weixin/try/report?id=' + temp.reportid + '">报告详情</span>';
				}
			}
			str += '</div>'
			+ '</div>'
			+ '</li>';
	}
	return str;
}

function memberList(info)//新朋友
{
	var str = '';
	for(var i = 0; i < info.length; i++)
	{
		var temp = info[i];
		str += '<li class="row ub cl-b-white clickable">'
			+ '<img src="' + temp.uavatar + '" class="tx-cir lazy">'
			+ '<div class="ub-f1 follow-content">'
			+ '<h3 class="f16 cl-f-dgrey msg-title">' + temp.nickname + '</h3>'
			+ '<p class="f14 cl-f-grey msg-text">' + temp.fansnum + '关注&nbsp;&nbsp;' + temp.worksnum + '个作品</p>'
			+ '</div>';
		if(temp.isFans > 0)
		{
			str += '<span class="icon-follow icon-follow-del lazy yf-follow" data-uid="' + temp.userid + '" data-type="cancel">';
		}
		else
		{
			str += '<span class="icon-follow icon-follow-add lazy yf-follow" data-uid="' + temp.userid + '" data-type="add">';
		}
		str += '</li>';
	}
	return str;
}

function getMessage()
{
	isLoading = true;
	if(pageStatus)
	{
		$('.add-loading').show();
		$.ajax({
			url: url,
			type: 'GET',
			dataType: 'json',
			data: {
				page: page,
				code: 'getPage',
			},
			success: function(res){
				if(res.status == 1)
				{
					var strTemp = window[$fucType](res.info);
					$thelist.append(strTemp);
					setTimeout(lazyloadImg($('.lazy'+page)), 1000);
					page++; 
					isLoading = false;
				}
				else
				{
					if(pageStatus){
						//addload.before('<p class="bottom-tips">— 已到最底部 —</p>').hide();
						pageStatus = false;
						isLoading = false;
					}
				}
				$('.add-loading').hide();
			},
			error: function(res){
				showToast('系统繁忙');
				$('.add-loading').hide();
			}
		});
	}
	else
	{
		showToast('已经没有了');
	}
}

var addload = {
   	isTrue : $('#scroll-wrapper').index() !== -1,
   	addssp : function(){
   		if(this.isTrue) {
   			if($('#scroll-wrapper').height()<$(window).height()-45)
   			{
   				$('.add-loading').remove();
   				return false;
   			}
   			var addload = $('.add-loading');
    		$(window).on('scroll',function(){
				if(isLoading == false)
				{
	    			var scrollPos = $(window).scrollTop(),wrapperH = $('#scroll-wrapper').height();
		    		if(scrollPos > wrapperH - $(window).height() + footH )
		    		{
		    			getMessage();
		    		}
				}
			}); 
   		}
   	}
}

function loading(){
	if($('.oimg').length>0){
		if($('.oimg').get(0).complete){
			$(".loading-wrapper").hide();
			addload.addssp();
		}
	}
	else{
		$(".loading-wrapper").hide();
		addload.addssp();
	}
}

document.onreadystatechange = loading;

$(document).ready(function() {
	lazyloadImg($('.lazy'));
});
    
    
